Repository navigation
fix(libSceAgcDriver): safely probe output parameters in sceAgcDriverGetHsOffchipParam and sceAgcDriverGetTFRing - #20001
Conversation
|
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
The change at aa4726311a012c97a315d8cdce541d96b6610cf7 safely copies the four output values through the guest-memory helper; no verified blocking defect was found.
What I ran
- Read the prepared description, commits, manifest, diff, and all three changed files at the pinned head.
- Read the implementation of
GuestCopyOut_nid_no_patchto check its failure and errno behavior. - No tests or build commands were run in this review; author-reported checks were not independently verified.
Results
| Check | Result | Note |
|---|---|---|
| Changed code review | passed | All three changed files read |
| Regression tests | not run | Author reports unit coverage |
| Convention and pointer audits | not run | Author reports clean checks |
Findings
Blocking
None.
Non-blocking
None.
Not verified
- The reported convention check, guest pointer audit, and unit test run were not performed during this review.
- Console behavior and host-specific test behavior were not independently confirmed.
- Read:
core/libs/prx/libSceAgcDriver/State/src/Configuration.cpp,core/libs/prx/libSceAgcDriver/tests/TessellationFactorRing.cpp, anddocs/dev/debt/libSceAgcDriver.md. Excluded: none; all changed files listed in the manifest were included and read.
To get this to a good state
Nothing is required.
|
Linux test report for aa47263, merged onto
|
|
@oneandonlydean All CI checks have passed cleanly, @MarcZX10 approved the head, and @c1b3r-p3d1a verified Linux test execution with negative controls passing. Ready for merge whenever you have a moment! |
|
Windows check of head
AI-assisted: yes. |
Linux check of head
|
| Linux | |
|---|---|
| Setup | Ubuntu 24.04.4 LTS (WSL2), GCC 13 |
| Build | clean |
| Passed | 1610 of 1887 |
| Failed | 99 |
| Not run (executable missing or test disabled) | 178 |
| Failures caused by this PR | 0 |
| Conventions | pass |
| Time | 15 min |
| Tests that ran | Linux |
|---|---|
agc_driver_* |
1037 of 1270 |
guest_system_* |
63 of 63 |
agc_shader_* |
53 of 53 |
guest_job_* |
29 of 29 |
agc_pipeline_* |
23 of 24 |
agc_storage_* |
12 of 20 |
guest_freetype_* |
15 of 15 |
guest_np_* |
14 of 14 |
| 199 other group(s) | 364 of 399 |
99 failed test(s) that also fail on main (not caused by this PR)
agc_carried_shadow, agc_collect_coverage_invalidation, agc_driver_bc_block_copy, agc_driver_depth_compare_copy, agc_driver_depth_plane_partial_store_upload_image, agc_driver_frame_replay, agc_driver_frame_replay_allocation_ranges, agc_driver_frame_replay_busy_queue, agc_driver_frame_replay_cold_pipelines, agc_driver_frame_replay_concurrent, agc_driver_frame_replay_fence_reuse, agc_driver_frame_replay_late_clear, agc_driver_frame_replay_once, agc_driver_frame_replay_partly_covered, agc_driver_frame_replay_pending_result, agc_driver_frame_replay_rewind, agc_driver_frame_replay_rewind_compute, agc_driver_frame_replay_rewind_copy, agc_driver_frame_replay_rewind_fill, agc_driver_frame_replay_rewind_page, agc_driver_frame_replay_rewind_release, agc_driver_frame_replay_rewind_reuse, agc_driver_frame_replay_rewind_split, agc_driver_frame_replay_rewind_store, agc_driver_frame_replay_shader, agc_driver_frame_replay_shader_host, agc_driver_frame_replay_shader_prologue_code, agc_driver_frame_replay_shader_prologue_header, agc_driver_frame_replay_shader_prologue_readonly, agc_driver_frame_replay_store_between_walks, agc_driver_frame_replay_wait_label, agc_driver_host_import_dma_buf_watch, agc_driver_image_srgb_sample_copy, agc_driver_image_srgb_sample_copy_forced, agc_driver_image_table_packed_guards, agc_driver_image_table_reuse_records, agc_driver_image_table_reuse_records_narrow, agc_driver_image_table_variants, agc_driver_image_table_vouch_queued_draws, agc_driver_lookup_log_fits_build, agc_driver_msaa_dcc_clear_2, agc_driver_msaa_dcc_clear_4, agc_driver_msaa_dcc_clear_8, agc_driver_msaa_dcc_compared_import_2, agc_driver_msaa_dcc_compared_import_4, agc_driver_msaa_dcc_compared_import_8, agc_driver_msaa_dcc_srgb_clear_2, agc_driver_msaa_dcc_srgb_clear_4, agc_driver_msaa_dcc_srgb_clear_8, agc_driver_native_color_initial_uniform_refusals, agc_driver_native_depth_aliased_depth_depth_only, agc_driver_native_depth_aliased_depth_no_stencil, agc_driver_native_depth_aliased_depth_stencil, agc_driver_native_depth_aliased_stencil, agc_driver_native_depth_bare_publication, agc_driver_native_depth_bda_clear, agc_driver_native_depth_buffer_clear, agc_driver_native_depth_clear_refusals, agc_driver_native_depth_clears, agc_driver_native_depth_covered_owner, agc_driver_native_depth_driver_path, agc_driver_native_depth_driver_queued_fill, agc_driver_native_depth_expand_gate, agc_driver_native_depth_htile_plane_alias, agc_driver_native_depth_initial_owner, agc_driver_native_depth_overwritten_planes, agc_driver_native_depth_overwritten_published, agc_driver_native_depth_pending_units, agc_driver_native_depth_publication, agc_driver_native_depth_publication_without_htile, agc_driver_native_depth_retirement, agc_driver_native_depth_separate_stencil, agc_driver_native_depth_single_sample_view, agc_driver_native_depth_smaller_extent, agc_driver_native_depth_stencil, agc_driver_native_depth_stencil_view, agc_driver_native_depth_stored_repeat_fill, agc_driver_native_depth_uneven_plane, agc_driver_native_depth_uniform_plane_alias, agc_driver_native_depth_uniform_planes, agc_driver_native_multisample_depth, agc_driver_recorder, agc_driver_resource_cache_collect_refusals, agc_driver_resource_cache_collect_refusals_index, agc_driver_resource_cache_collect_refusals_narrow, agc_driver_resource_cache_lookup_changed, agc_driver_resource_cache_pending_fail_count, agc_driver_resource_cache_pending_fail_count_index, agc_driver_resource_cache_replaced_texture, agc_driver_sample_multisample_target, agc_driver_sampled_cache_budget, agc_driver_sampled_cache_budget_without_storage_image_multisample, agc_driver_sampled_clear_keys, agc_driver_staged_clear_sampled_read, agc_driver_staged_clear_sampled_read_draw_pipeline, agc_driver_staged_clear_sampled_read_plan_verify, agc_driver_storage_flush_ordering, agc_storage_idle_writeback_race, agc_storage_kept_unit_settle
178 test(s) not run
agc_collect_mapping_history_map, agc_collect_mapping_history_uncached, agc_draw_input_mirrors, agc_draw_input_mirrors_off, agc_draw_input_reuse, agc_driver_alpha_to_coverage_sample_mask_export, agc_driver_bda_reads_shadowed_results, agc_driver_bda_reads_shadowed_results_per_build, agc_driver_bitfield_mask, agc_driver_cached_image_multisample_guard, agc_driver_coherent_atomic_loads, agc_driver_coherent_atomic_loads_enabled, agc_driver_conservative_rasterization, agc_driver_dcc_keys_partial_rewrite_keeps_store, agc_driver_dcc_keys_rewrite_after_epoch_proof, agc_driver_dcc_keys_rewrite_after_memo, agc_driver_dcc_keys_rewrite_after_refresh_proof, agc_driver_dcc_keys_rewrite_to_register_clear, agc_driver_dcc_keys_write_beside_keys_keeps_store, agc_driver_depth_plane_cpu_write_after_memo, agc_driver_depth_plane_cpu_write_after_page_unwatch, agc_driver_depth_plane_cpu_write_after_partial_unwatch, agc_driver_depth_plane_guest_layers, agc_driver_dithered_alpha_to_coverage, agc_driver_dpp16_inactive_source, agc_driver_dpp16_operands, agc_driver_dpp16_row_share_xmask, agc_driver_dpp8, agc_driver_ds_append_consume, agc_driver_ds_permute, agc_driver_ds_swizzle, agc_driver_float16_nan_probe, agc_driver_float16_native, agc_driver_float16_unused_nan_payloads, agc_driver_gcn_compare_exec_writes, agc_driver_gds_append_consume, agc_driver_global_atomic_csub, agc_driver_global_store_addtid, agc_driver_host_write_shadowed_unit, agc_driver_idle_store_over_unmap, agc_driver_image_sample_lod_clamp, agc_driver_image_table_reuse_retaken_cleared_depth_surface, agc_driver_image_table_reuse_retaken_depth_surface, agc_driver_image_table_reuse_retaken_mirrored_depth_surface, agc_driver_image_table_reuse_retired_depth_surface, agc_driver_image_table_vouched_lookups, agc_driver_large_tracked_snapshot, agc_driver_layered_volume_mesh, agc_driver_lds_addtid, agc_driver_lds_mask_waterfall, agc_driver_lds_subword_store_branch, agc_driver_lds_tree_reduction, agc_driver_linear_target_direct_write_completion, agc_driver_linear_target_dma_buf_creation, agc_driver_linear_target_dma_buf_refusal, agc_driver_linear_target_dma_buf_watch_loss_after, agc_driver_linear_target_dma_buf_watch_loss_before, agc_driver_linear_target_import_creation, agc_driver_look_back_scan, agc_driver_memo_pending_collect, agc_driver_memo_pending_collect_compared, agc_driver_mesh, agc_driver_mesh_barycentric_emulation, agc_driver_mesh_draw_relocation, agc_driver_mesh_index_cache, agc_driver_mesh_provoking_layer, agc_driver_mesh_provoking_vertex, agc_driver_mesh_waves, agc_driver_multisample_centered_lines, agc_driver_native_fmask_2, agc_driver_native_fmask_8, agc_driver_ngg_vertex_wave_info, agc_driver_ngg_vertex_wave_reduction, agc_driver_optimize_on_fiber, agc_driver_packed_float16_native, agc_driver_partially_committed_array, agc_driver_partially_committed_array_samples, agc_driver_partially_committed_volume, agc_driver_partially_committed_volume_bc, agc_driver_partially_committed_volume_bc_samples, agc_driver_partially_committed_volume_compare, agc_driver_partially_committed_volume_empty, agc_driver_partially_committed_volume_empty_samples, agc_driver_partially_committed_volume_linear, agc_driver_partially_committed_volume_linear_samples, agc_driver_partially_committed_volume_mips, agc_driver_partially_committed_volume_mips_samples, agc_driver_partially_committed_volume_page_samples, agc_driver_partially_committed_volume_samples, agc_driver_partially_committed_volume_thick, agc_driver_partially_committed_volume_thick_samples, agc_driver_partially_committed_volume_whole, agc_driver_partially_committed_volume_whole_samples, agc_driver_partially_resident_pending_stores, agc_driver_partially_resident_snapshot, agc_driver_permlane16, agc_driver_pipeline_optimized_readback_color32, agc_driver_pipeline_optimized_readback_color32_fast, agc_driver_pipeline_optimized_readback_color32_unsuppressed, agc_driver_pipeline_optimized_readback_color64, agc_driver_pipeline_optimized_readback_color64_fast, agc_driver_pipeline_optimized_readback_color64_unsuppressed, agc_driver_pipeline_statistics_report, agc_driver_pixel_helper_lanes, agc_driver_pixel_helper_waterfall, agc_driver_pixel_lds, agc_driver_pixel_lds_lane_slots, agc_driver_pixel_lds_limit, agc_driver_pixel_quad_perm_helpers, agc_driver_pixel_valid_mask, agc_driver_read_first_lane, agc_driver_read_lane, agc_driver_recorded_draw_staging, agc_driver_relative_dpp, agc_driver_relative_indexing_known_bits, agc_driver_repeated_fill_elision, agc_driver_resident_heap_mirror, agc_driver_sample_order_grid_reference, agc_driver_sample_order_recipe_depth_locations, agc_driver_scalar_bit_count, agc_driver_scattered_runs, agc_driver_selected_dma_buf_list_refusal, agc_driver_selected_dma_buf_list_refusal_access, agc_driver_selected_sparse_dma_buf_failure, agc_driver_spanned_ballot_sequence, agc_driver_sparse_dma_buf_import, agc_driver_stencil_copy_draw, agc_driver_storage_guest_copy_release, agc_driver_subvector_loop, agc_driver_table_index_validation, agc_driver_tessellation_geometry, agc_driver_texture_sparse_levels, agc_driver_two_sample_alpha_to_coverage_sample_mask_export, agc_driver_two_sample_dithered_alpha_to_coverage, agc_driver_unit_shadow, agc_driver_unit_shadow_budget, agc_driver_upload_cache_read_only_flush, agc_driver_vertex_clip_cull_distances, agc_driver_wait_idle_queue_locks, agc_driver_wave32_subgroup, agc_driver_wave_shared_vgprs, agc_driver_wave_uniform, agc_driver_write_lane, agc_hook_clear_access, agc_hook_clear_access_off, agc_host_import_sparse, agc_idle_publish_dmabuf_wait, agc_idle_publish_wait, agc_import_settle_initial_dcc, agc_map_gate_disjoint, agc_map_gate_fast_path, agc_map_gate_pending, agc_map_gate_publication, agc_map_gate_retry, agc_map_gate_stress, agc_pipeline_cache_file, agc_repeated_neighbour_stores, agc_shadowed_key_stores, agc_shared_write_partial_collect, agc_small_tiled_shadow_label, agc_snapshot_read_into_staging, agc_storage_clear_hand_over, agc_storage_pending_after_unwatch, agc_storage_pending_key_refresh, agc_storage_rewritten_blocks, agc_storage_rewritten_stale_units, agc_storage_written_buffer_order, agc_unit_shadow, agc_unit_shadow_completion_store, agc_unwatch_hook_lock_order, agc_unwatch_snapshot_scope, agc_unwatch_snapshot_scope_edge, agc_unwatch_snapshot_scope_linear, agc_unwatch_snapshot_scope_linear_refresh, agc_unwatch_snapshot_scope_refresh, agc_write_tracking, agc_write_tracking_generation_wrap, agc_write_tracking_mark_order
Only tests that depend on the files this PR changes were run. A test counts against the PR only if it passes on main. Numbers come from ctest; the text is generated by a script.
778f9f8 to
2310793
Compare
|
Tested head Setup: Windows 11 Pro 10.0.26200, Ryzen 7 9800X3D, WinLibs GCC 15.2.0 r7, Release,
Whole batch: the full This is one combined tree, not a run of this PR alone. AI-assisted: yes (Claude Code) |
|
Thank you @kiwe147 for verifying that |
…etHsOffchipParam and sceAgcDriverGetTFRing
…erGetHsOffchipParam and sceAgcDriverGetTFRing
2310793 to
5932586
Compare
|
@oneandonlydean Rebased onto latest
|
What
This pull request ensures that output pointers passed to
sceAgcDriverGetHsOffchipParam(granularity,buffering) andsceAgcDriverGetTFRing(base,size) inlibSceAgcDriverare safely probed viaGuestCopyOut_nid_no_patchbefore write-back, avoiding host hardware segmentation faults on unwritable or unmapped guest memory.Specifically:
granularityandbufferinginsceAgcDriverGetHsOffchipParamviaGuestCopyOut_nid_no_patch, preserving guesterrnoand rejecting unwritable pointers withstd::invalid_argumentcleanly.baseandsizeinsceAgcDriverGetTFRingviaGuestCopyOut_nid_no_patch, preserving guesterrnoand rejecting unwritable pointers withstd::invalid_argumentcleanly.core/libs/prx/libSceAgcDriver/tests/TessellationFactorRing.cppverifying rejection of unwritable output pointers (reinterpret_cast<uint16_t*>(0x10),reinterpret_cast<uintptr_t*>(0x10),reinterpret_cast<uint32_t*>(0x10)) and confirming guesterrnopreservation (errno == 71).docs/dev/debt/libSceAgcDriver.md.Tested
python tools/check_conventions.py --base origin/main(0 findings, 0 errors).python tools/guest_pointer_audit.py libSceAgcDriver(0 remaining findings insceAgcDriverGetHsOffchipParamandsceAgcDriverGetTFRing).TessellationFactorRing.cpp.Checklist